/*
 * BluePadDiscoverer.java
 *
 * Created on February 24, 2007, 3:34 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.bloomingstars.bluepad.server;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.bluetooth.BluetoothStateException;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;

/**
 *
 * @author toni
 */
public final class BluePadDiscoverer
{    
    public void execute()
    {
        try
        {
            LocalDevice localDevice = LocalDevice.getLocalDevice();
            DiscoveryAgent discoveryAgent = localDevice.getDiscoveryAgent();
            
            System.out.println("Starting device inquiry...");
            discoveryAgent.startInquiry(DiscoveryAgent.GIAC, new BluePadDiscoveryListener());
        }
        catch (BluetoothStateException e)
        {
            System.err.println("Problems while inquiring for devices");
            e.printStackTrace();
        }
    }
    
}
